package net.comm.group.db;


import java.sql.ResultSet;
import java.sql.SQLException;


import net.comm.group.bean.BaseGFollForum;
import net.comm.group.bean.BaseGForum;
import net.comm.group.bean.BaseGroups;
import net.comm.oper.bean.Baseoperlog;
import net.comm.util.StringUtil;

import org.sakaiproject.db.api.SqlReader;

public class DbGFollForumService implements SqlReader
{

	/**
	 * Read from the result one set of fields to create a Resource.
	 * 
	 * @param result
	 *        The Sql query result.
	 * @return The Resource object.
	 */
	public Object readSqlResultRecord(ResultSet result)
	{
		try
		{
			
			int  	gFollowID = result.getInt(1);	//
			int  	gupFollID = result.getInt(2);							//被跟帖序号
			int  	gForumID = result.getInt(3);					//帖子序号
			int  	groupID = result.getInt(4);						//群组ID
			String  title = StringUtil.getValue(result.getString(5));		//
			String  content = StringUtil.getValue(result.getString(6));		//发贴/跟贴内容
			int  	fileID = result.getInt(7);									//
			int  	upUserID = result.getInt(8);						//
			int  	userID = result.getInt(9);								//
			String  IP = StringUtil.getValue(result.getString(10));		//
			String  mTime = StringUtil.getValue(result.getString(11));		//

			// create the Resource from these fields
			return new BaseGFollForum( gFollowID, gupFollID, gForumID,
					groupID, title, content, fileID, upUserID, userID, IP,mTime);
		}
		catch (SQLException e)
		{
			return null;
		}
		
	}
}
